<extend name="Base/common"/>

<block name="style">
    <link href="__CSS__/help.css" rel="stylesheet" type="text/css"/>

</block>

<block name="body">
    <div class="col-xs-12">
        <!--userinfo-->
        <include file="Public/user_info"/>
        <include file="Public/_top_menu"/>

    </div>


    <div class="col-md-9">
        <div class="bgwhite pull-left" style="width: 100%;margin-top: 0;padding-bottom: 20px;">
            <div class="help_h">
                <a href="{:U('help/usercenter/publish',array('uid'=>$uid))}" class="pull-left " style="width: 140px;">发布的帮忙</a>
                <a href="{:U('help/usercenter/attend',array('uid'=>$uid))}" class="pull-left active" style="width: 140px;">参加的帮忙</a>


            </div>

            <div class="help_list pull-left" style="width: 100%;margin-top: 0;padding-left: 10px;padding-right: 10px;">
                <if condition="!$list">
                    <div class="row">
                        <div class="col-xs-12">
                            <p class="text-muted" style="text-align: center; font-size: 3em;">
                                <br/><br/>
                                没有符合的帮忙～
                                <br/><br/><br/>
                            </p>
                        </div>
                    </div>
                </if>
                <volist name="list" id="vo">
                    <li class="col-lg-4 col-sm-6 help_one help_attend">
                        <dl style="max-width: 257px;width: 100%">
                            <dt style="position: relative;">
                                <a class="help_img" href="{:U('help/index/detail',array('id'=>$vo['id']))}" style="width:100%;" target="_blank">
                                    <img src="{:getThumbImageById($vo['cover_id'],257,257)}"
                                         style="width:100%;max-width: 257px;height: 257px" class=""/>

                                    <div class="help_title_cav"></div>
                                    <div class="help_title">{$vo.title}</div>
                                </a>
                            </dt>
                            <dd style="font-size: 12px;">


                                <div style="padding: 5px 10px 5px 10px;font-size: 16px; "><a class="author " href="{$vo.user.space_url}"
                                                                           ucard="{$vo.user.uid}">
                                    {$vo.user.nickname} </a></div>
                                <div style="padding: 0 10px ">
                                    好评率<span> {$vo.rate|default=0}%</span>&nbsp;&nbsp;
                                   <span class="pull-right"> 已报名<span> {$vo.sign_count|default=0}</span>&nbsp;&nbsp;
                                   {$vo.state|get_help_condition}</span>
                                </div>
                                <php>if(check_can_edit($vo['id'])){</php>
                                <div class="help_attend_action action">
                                    <php>if(check_is_evaluate($vo['id'])){</php>

                                    <a href="javascript:" style="color: #000" class="col-xs-6 text-center pull-left ">已评价</a>
                                    <php>}else{</php>
                                    <a href="{:U('help/usercenter/evaluate',array('id'=>$vo['id']))}"
                                       class="col-xs-6 text-center pull-left help_evaluate">评价</a>
                                    <php>}</php>


                                    <php>if(check_is_complain($vo['id'])){</php>
                                    <a href="javascript:" style="color: #000" class="col-xs-6 text-center ">已投诉</a>
                                    <php>}else{</php>
                                    <a href="{:U('help/usercenter/complain',array('id'=>$vo['id']))}"
                                       class="col-xs-6 text-center help_complain">投诉</a>
                                    <php>}</php>
                                </div>
                                <php>}</php>
                            </dd>
                        </dl>
                    </li>
                </volist>


            </div>

            <div class="clearfix text-center">
                {:getPagination($totalCount,$r)}
            </div>
        </div>
    </div>
    <div class="col-md-3 col-xs-12">
        <div class="bgwhite" style="padding-bottom: 20px;margin-top: 0">
            {:W('HelpMe/lists',array('uid'=>$uid))}
        </div>
    </div>
</block>
<block name="script">
    <script>
        $(function () {
            bindHelpComplain();
            bindHelpEvaluate();
        });
        function bindHelpEvaluate() {
            $('.help_evaluate').magnificPopup({
                type: 'ajax',
                overflowY: 'scroll',
                modal: true,
                callbacks: {
                }
            });
        }
        function bindHelpComplain() {
            $('.help_complain').magnificPopup({
                type: 'ajax',
                overflowY: 'scroll',
                modal: true,
                callbacks: {
                }
            });
        }
    </script>

</block>
